<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

    <head>
        <meta charset="utf-8">
            <title>淘天机站群系统管理后台</title>
            <!-- include header_meta -->
    </head>

    <body>
        <!-- include header -->
        <div class="rightframe">
            <div class="cp-wrap {if $jnarrow}jnarrow{/if}">
                <div class="dashboard">
                    <div class="tip-box rewritetip" style="display:none;">
                        伪静态未设置完成，网站可能无法访问，请检查服务器是否配置正确。<a href="http://www.xinlingku.cn/t_24_1_1.html" target="_blank">伪静态配置教程</a>
                    </div>

                    <div class="cl">
                        <div class="box">
                            <div class="box-title">数据总览</div>
                            <div class="box-content dataPreView">
                                <div class="dpanel">
                                    <div class="line-top">
                                        <p class="title">站点总数</p>
                                        <p class="content"><a href="?m=yuming&a=index">{$yumingCount}</a></p>
                                    </div>
                                    <div class="line-bottom">
                                        <a href="?m=yuming&a=add" class="btn">创建站点</a>
                                    </div>
                                </div>
                                <div class="dpanel">
                                    <div class="line-top">
                                        <p class="title">文章总数</p>
                                        <p class="content"><a href="?m=article&a=index">{$newsCount}</a></p>
                                    </div>
                                    <div class="line-bottom">
                                        <a href="?m=article&a=add" class="btn">发表文章</a>
                                    </div>
                                </div>
                                <div class="dpanel">
                                    <div class="line-top">
                                        <p class="title">今日文章数</p>
                                        <p class="content">{$todayCount}</p>
                                    </div>
                                    <div class="line-bottom">
                                        保持每日更新文章利于提高网站权重
                                    </div>
                                </div>
                                <div class="dpanel">
                                    <div class="line-top">
                                        <p class="title">今日访问量</p>
                                        <p class="content">{$visitCount}</p>
                                    </div>
                                    <div class="line-bottom">
                                        随着积累权重和流量会逐步提升
                                    </div>
                                </div>
                                <div class="dpanel">
                                    <div class="line-top">
                                        <p class="title">今日爬虫抓取次数</p>
                                        <p class="content">{$spiderCount}</p>
                                    </div>
                                    <div class="line-bottom">
                                        适当增加外链有助于增加爬虫量
                                    </div>
                                </div>
                                <div class="dpanel">
                                    <div class="line-top">
                                        <p class="title">今日自动推送量</p>
                                        <p class="content">{$jscdata['total']}</p>
                                    </div>
                                    <div class="line-bottom">
                                        今日所有站点自动推送链接到百度总量
                                    </div>
                                </div>

                            </div>
                        </div>

                        <div class="cp-table">
                            <div id='container'>

                            </div>

                        </div>


                        <div class="box" style="padding-top:50px;">
                            <div class="box-title">系统信息</div>
                            <div class="box-content">
                                <p><span>服务器：</span>{php_uname('s')}</p>
                                <p><span>剩余空间：</span>{$free_space}</p>
                                <p><span>系统时间：</span>{date("Y-m-d H:i:s")}</p>
                            </div>
                        </div>
                    </div>

                </div>
            </div>

        </div>

        <!-- include footer -->
    </body>
    <script type="text/javascript" src="__APPROOT__/js/echarts.min.js"></script>
    <script>

        $(function () {
            $.get("?m=dashboard&a=get_count_lists", function (res) {
                if (res.status == 1) {
                    var datas = res.data;
                    $('#container').append('<div id="jsc_pai" style="height: 600px;width:90%;margin-top:20px;"></div>');
                    var dom = document.getElementById('jsc_pai');
                    map(dom, "今天推送量统计", datas.x, datas.y, datas.y_count, datas.y_bad,datas.color_list);
                }
            }, 'json');

        });


        function map(dom, title, xdata, ydata, ycount, ybad,colorlists) {
            //var dom = document.getElementById("container");
            var myChart = echarts.init(dom);
            var app = {};
            app.title = title;
            //var colorlists = ['rgb(255, 255, 50)', 'rgb(9, 242, 9)', 'rgb(6, 215, 6)', 'rgb(164, 194, 244)', 'rgb(194, 123, 160)', 'rgb(230, 184, 175)', 'rgb(244, 204, 204)', 'rgb(195,129,235)', 'rgb(195,150,90)', 'rgb(182,219,35)'];
            var option = null;
            option = {
                color: ['#3398DB'],
                tooltip: {
                    trigger: "axis",
                    axisPointer: {type: 'shadow'},
                    formatter: function (params, ticket, callback) {
                        return '域名：' + ycount[params[0].dataIndex] + "<br />" +
                                'ID：' + ybad[params[0].dataIndex] + "<br />" + '推送量：' + params[0].data;
                    }
                },
                toolbox: {
                    show: true,
                    feature: {
                        magicType: {show: true, type: ['line', 'bar']},
                        restore: {show: true}
                    }
                },
                title: {
                    text: title,
                },
                grid: {
                    left: '1%',
                    right: '1%',
                    bottom: '3%',
                    containLabel: true
                },
                xAxis: [
                    {
                        type: 'category',
                        data: xdata,
                        axisTick: {
                            alignWithLabel: true
                        },
                        scale: true,
                        name: '数字',
                    }
                ],
                yAxis: [
                    {
                        type: 'value',
                        scale: false,
                        name: '推送量',
                        axisLabel: {
                            formatter: '{value}'
                        }
                    }
                ],
                dataZoom: [
                    {
                        show: true,
                        start: 0,
                        end: 10
                    },
                    {
                        type: 'inside',
                        start: 0,
                        end: 10
                    }
                    
                ],
                series: [
                    {
                        type: 'bar',
                        barWidth: '80%',
                        data: ydata,
                        itemStyle: {
                            //通常情况下：
                            normal: {
                                //每个柱子的颜色即为colorList数组里的每一项，如果柱子数目多于colorList的长度，则柱子颜色循环使用该数组
                                color: function (params) {
                                    var colorList = colorlists;
                                    return colorList[params.dataIndex];
                                }
                            },
                            //鼠标悬停时：
                            emphasis: {
                                shadowBlur: 10,
                                shadowOffsetX: 0,
                                shadowColor: 'rgba(0, 0, 0, 0.5)',

                            }
                        },
                        label: {
                            normal: {
                                show: true,
                                position: 'top',
                                color: '#000',
                                fontSize: 14,
                                formatter: '{c}'
                            }
                        }
                    }
                ]
            };
            if (option && typeof option === "object") {
                myChart.setOption(option, true);
            }
        }
    </script>
</html>